package com.nanhang.controller;

import com.nanhang.common.util.R;
import com.nanhang.entity.Classes;

import com.nanhang.service.ClassesService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
@RequestMapping("/classes")
public class ClassController {
    @Autowired
    private ClassesService classesService;
    @GetMapping("/list")
    public R findAll(){
        List<Classes> list = classesService.list();

        return R.ok().data("classes",list);
    }
}
